package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.heart.mapper.CarCostMapper;
import com.ly.heart.service.ICarCostService;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.CarCostEntity;

import javax.annotation.Resource;

/**
 * 车辆费用单Service业务层处理
 *
 * @author cxl
 * @date 2024-09-08
 */
@Service
public class CarCostServiceImpl extends ServiceImpl<CarCostMapper,CarCostEntity> implements ICarCostService {

    @Resource
    private CarCostMapper carCostMapper;

    /**
     * 查询车辆费用单
     *
     * @param id 车辆费用单ID
     * @return 车辆费用单
     */
    @Override
    public CarCostEntity selectCarCostEntityById(String id)
    {
        return carCostMapper.selectCarCostEntityById(id);
    }

    /**
     * 查询车辆费用单列表
     *
     * @param carCostEntity 车辆费用单
     * @return 车辆费用单
     */
    @Override
    public List<CarCostEntity> selectCarCostEntityList(CarCostEntity carCostEntity)
    {
        return carCostMapper.selectCarCostEntityList(carCostEntity);
    }

    /**
     * 新增车辆费用单
     *
     * @param carCostEntity 车辆费用单
     * @return 结果
     */
    @Override
    public int insertCarCostEntity(CarCostEntity carCostEntity)
    {
        carCostEntity.setCreateTime(DateUtils.getNowDate());
        return carCostMapper.insertCarCostEntity(carCostEntity);
    }

    /**
     * 修改车辆费用单
     *
     * @param carCostEntity 车辆费用单
     * @return 结果
     */
    @Override
    public int updateCarCostEntity(CarCostEntity carCostEntity)
    {
        carCostEntity.setUpdateTime(DateUtils.getNowDate());
        return carCostMapper.updateCarCostEntity(carCostEntity);
    }

    /**
     * 批量删除车辆费用单
     *
     * @param ids 需要删除的车辆费用单ID
     * @return 结果
     */
    @Override
    public int deleteCarCostEntityByIds(String[] ids)
    {
        return carCostMapper.deleteCarCostEntityByIds(ids);
    }

    /**
     * 删除车辆费用单信息
     *
     * @param id 车辆费用单ID
     * @return 结果
     */
    @Override
    public int deleteCarCostEntityById(String id)
    {
        return carCostMapper.deleteCarCostEntityById(id);
    }
}
